package com.system.presideover.controller;


import com.system.common.result.Result;
import com.system.presideover.entity.Schedule;
import com.system.presideover.entity.Slideshow;
import com.system.presideover.service.SlideshowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 轮播图 前端控制器
 * </p>
 *
 * @author system
 * @since 2024-04-16
 */
@Api(tags = "轮播图")
@RestController
@RequestMapping("/presideover/slideshow")
public class SlideshowController {

    @Autowired
    private SlideshowService slideshowService;

    @ApiOperation(value = "展示轮播图")
    @GetMapping("/listSlideshow")
    public Result listSlideshow(){
        List<Slideshow> list = slideshowService.list();
        return Result.ok(list);
    }

    @ApiOperation(value = "修改档期")
    @PostMapping("/updateSlideshow")
    public Result updateSlideshow(@RequestBody Slideshow accountNumber){
        boolean save = slideshowService.updateById(accountNumber);

        if (save){
            return Result.ok().message("修改成功");
        }
        return Result.fail().message("修改失败");
    }

}

